<?php /* Smarty version Smarty-3.1.6, created on 2018-05-21 00:48:03
         compiled from "D:/phpStudy/PHPTutorial/WWW/myshop/Home/View\User\favlist.html" */ ?>
<?php /*%%SmartyHeaderCode:12947100255afe71507d2cb2-06931805%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'df6ca25a7074a3bce4b6f20873518dd9722e3304' => 
    array (
      0 => 'D:/phpStudy/PHPTutorial/WWW/myshop/Home/View\\User\\favlist.html',
      1 => 1526834879,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '12947100255afe71507d2cb2-06931805',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.6',
  'unifunc' => 'content_5afe71508e131',
  'variables' => 
  array (
    'favgoods' => 0,
    'v' => 0,
    'total' => 0,
    'price' => 0,
    'jifen' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5afe71508e131')) {function content_5afe71508e131($_smarty_tpl) {?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>购物车</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="<?php echo @PUBLIC_PATH;?>
css/amazeui.min.css"/>
<link rel="stylesheet" href="<?php echo @IMAGES_PATH;?>
style.css"/>
<script src="<?php echo @PUBLIC_PATH;?>
js/jquery.min.js"></script>
<script src="<?php echo @PUBLIC_PATH;?>
js/amazeui.min.js"></script>
</head>

<body>
<div class="container">
	<!--引入头文件-->
	<?php echo $_smarty_tpl->getSubTemplate ("../header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

	<script>$('.title-link').text("我的收藏")</script>
	
    <div class="am-cf cart-panel" style="min-height: 700px;">
    	<div class="cart-list-panel">
            <ul class="am-avg-sm-1 cart-panel-ul">
            	<?php if (empty($_smarty_tpl->tpl_vars['favgoods']->value)){?>
    				<div class="cart_foot" style="text-align: center;">你没有收藏任何商品哦┭┮﹏┭┮</div>
    				<a href="<?php echo @__MODULE__;?>
/IntegralGoods/cats"><div class="cart_foot" style="text-align: center;">去浏览下吧</div></a>
            	<?php }else{ ?>
            	<?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['favgoods']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                <li class="favli<?php echo $_smarty_tpl->tpl_vars['v']->value['id'];?>
">
            	<a href="<?php echo @__MODULE__;?>
/IntegralGoods/goodsdetail/id/<?php echo $_smarty_tpl->tpl_vars['v']->value['id'];?>
">
                	<div class="imgpanel"><img src="<?php echo $_smarty_tpl->tpl_vars['v']->value['main_img'];?>
" class="am-img-responsive" /></div>
                	<div class="infopanel">
                    	<h3><?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
</h3>
                    	<p>价格：<span class="red2 bold"><?php echo $_smarty_tpl->tpl_vars['v']->value['price'];?>
</span> 积分  </p>
                        <p>收藏数：<?php echo $_smarty_tpl->tpl_vars['v']->value['fav_cnt'];?>
</p>
                        <p>共被兑换：<span class="red2 bold"><?php echo $_smarty_tpl->tpl_vars['v']->value['salecount'];?>
件</span></p>
                        <p><span class="am-fr"><a data-id="<?php echo $_smarty_tpl->tpl_vars['v']->value['id'];?>
" class="am-badge am-badge-danger am-round deletefav">删除</a></span>库存：<span class="red2 bold"><?php echo $_smarty_tpl->tpl_vars['v']->value['count'];?>
</span> 件</p>
                    </div>
                </a>
                </li>
                <?php } ?>
                <?php }?>
            </ul>
        </div>
    </div>
    <div class="cart_foot" style="display: none;">共选中<span class="red2 bold" id="total_good"><?php echo $_smarty_tpl->tpl_vars['total']->value;?>
</span>种商品；总价：<span class="red2 bold" id="total_amount"><?php echo $_smarty_tpl->tpl_vars['price']->value;?>
</span>元；总积分：<span class="red2 bold" id="total_jifen"><?php echo $_smarty_tpl->tpl_vars['jifen']->value;?>
</span></div>
    <div class="cart-tool" style="display: none;">
    	<a class="am-btn am-btn-sm am-btn-success" href="#">
          <i class="am-icon-chevron-left"></i>
          返回
        </a>
        <a class="am-btn am-btn-sm am-btn-warning" href="#">
          <i class="am-icon-shopping-cart"></i>
          结账
        </a>
    </div>
    
    
    <footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
        <hr data-am-widget="divider" style="" class="am-divider am-divider-default"/>
      <div class="am-footer-miscs ">
        <p>CopyRight©2014 AllMobilize Inc.</p>
        <p>京ICP备13033158</p>
      </div>
    </footer>
    <!--底部-->
    <?php echo $_smarty_tpl->getSubTemplate ("../footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

</div>
<script>
	$('.deletefav').click(function(){
//		var thisgoods=$(this);
//		var id=thisgoods.data('id');
//		$('.favli'+id).hide();
		if(confirm("确定删除该收藏吗？")){
			var thisgoods=$(this);
			var data={
				id:thisgoods.data('id'),
			}
		$.post("<?php echo @__CONTROLLER__;?>
/deletefav", data, function(ret){
			console.log(ret);
			if(ret){
				$('.favli'+data.id).hide();
//				alert("收藏了");
			}else{
				alert("删除失败");
//				alert("取消了");
			}
		})
		}
	})
</script>
</body>
</html>
<?php }} ?>